import org.w3c.dom.ls.LSOutput;

import java.io.*;
import java.util.Scanner;

//博客
public class book {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入要删除的路径");
        String del = sc.nextLine();

        //删除
        System.out.println(del);
        File file1 = new File(del);

        System.out.println(file1.exists());
        System.out.println(file1.isFile());

        System.out.println(file1.delete());
//        File f = new File("F:\\text\\text1.txt");
//        System.out.println(f.delete());
    }
    public static void main2(String[] args) throws IOException {


        //stream
        File file = new File("book.txt");

        InputStream io = new FileInputStream(file);

        Scanner sc = new Scanner(io);

        io.read();
        io.close();


        //字符流
        FileReader fr = new FileReader(file);

        OutputStream os = new FileOutputStream("book2.txt");

        PrintWriter pw = new PrintWriter(os);

        try(BufferedReader br = new BufferedReader(fr)) {

        }




    }
    public static void main1(String[] args) {
        File file = new File("book.txt");
        System.out.println(file.getPath());
        System.out.println(file.getAbsolutePath());

        File file1 = new File("../../bo.txt");
        System.out.println(file1.getPath());
        System.out.println(file1.getAbsolutePath());

        file.getPath();
        file.getAbsolutePath();
        file.exists();
        System.out.println(file.getName());
        file.isFile();
        file.isDirectory();

//        try {
//            file.createNewFile();
//        } catch (IOException e) {
//            throw new RuntimeException(e);
//        }

        System.out.println(file.mkdir());
        file.mkdirs();
        System.out.println(file.isFile());
        System.out.println(file.isDirectory());

        file.list();
        System.out.println(file.isAbsolute());
        file.canRead();
        file.canWrite();

        file.renameTo(new File("book.txt"));
        Integer a;
        String s;
//        System.out.println(a);
//        System.out.println(s);
    }



}
